package abhiWeb.com.abhi.service.video.service;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import abhiWeb.com.abhi.service.common.ConnectionManager;
import abhiWeb.com.abhi.transfer.video.VideoDisplayDO;

public class VideoService {
	
		//private Connection dataSource;
	    private Connection connection;
	    private Statement statement;
	    
	    private VideoDisplayDO vdo;
	    
	     
	    public VideoDisplayDO testing() throws Exception{
	 
	            
		        ResultSet resultSet = null;
		        try {
		            // Get Connection and Statement
		            connection = ConnectionManager.getConnection();
		            statement = connection.createStatement();
		            String query = "SELECT * FROM STUDENT";
		            resultSet = statement.executeQuery(query);
		            while (resultSet.next()) {
		                vdo.setId(resultSet.getString(1));
		                vdo.setName(resultSet.getString(2));
		            }
		        } catch (Exception e) {
		            e.printStackTrace();
		        }finally {
		            try { if(null!=resultSet)resultSet.close();} catch (SQLException e) 
		            {e.printStackTrace();}
		            try { if(null!=statement)statement.close();} catch (SQLException e) 
		            {e.printStackTrace();}
		            try { if(null!=connection)connection.close();} catch (SQLException e) 
		            {e.printStackTrace();}
		        }
	             
		        
		        return vdo;
	      
	    }


}
